package com.yanqu.road.server.cross.service;

import com.google.protobuf.AbstractMessage;
import com.google.protobuf.InvalidProtocolBufferException;
import com.yanqu.road.entity.union.cross.CrossUnionInfo;
import com.yanqu.road.logic.cross.CrossActivityRankListModel;
import com.yanqu.road.logic.pb.UnionBasePb;
import com.yanqu.road.pb.activity.PeakStrongholdWarProto;
import com.yanqu.road.pb.commonactivity.CommonActivityProto;
import com.yanqu.road.pb.rank.RankProto;
import com.yanqu.road.pb.syncMessage.SyncMessage;
import com.yanqu.road.pb.syncMessage.SyncUnion;
import com.yanqu.road.pb.union.UnionProto;
import com.yanqu.road.server.command.ICrossServiceCommand;
import com.yanqu.road.server.manager.activity.ActivityMgr;
import com.yanqu.road.server.manager.activity.ActivityRankMgr;
import com.yanqu.road.server.manager.peakstronghold.CrossPeakStrongholdMgr;
import com.yanqu.road.server.manager.union.CrossUnionMgr;
import com.yanqu.road.server.manger.CrossUnionServerGroupMgr;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;

@Deprecated
public class PeakHoldUpdateDefendCrossServiceCmd implements ICrossServiceCommand {
    @Override
    public CompletableFuture<AbstractMessage.Builder<?>> execute(SyncMessage.Request request) throws InvalidProtocolBufferException {
        PeakStrongholdWarProto.CrossPeakHoldDefendPatronUpdateRespMsg reqMsg = PeakStrongholdWarProto.CrossPeakHoldDefendPatronUpdateRespMsg.parseFrom(request.getDataBytes());
        CrossPeakStrongholdMgr.updateMemberDefendInfo(reqMsg.getActivityId(), reqMsg);

        PeakStrongholdWarProto.CrossPeakHoldUpdateRespMsg.Builder respMsg = PeakStrongholdWarProto.CrossPeakHoldUpdateRespMsg.newBuilder();
        respMsg.setActivityId(reqMsg.getActivityId());
        CompletableFuture<AbstractMessage.Builder<?>> completableFuture = new CompletableFuture<>();
        completableFuture.complete(respMsg);
        return completableFuture;
    }
}
